package app.thread;

/**
 * 基础线程
 * @author zoe
 * 2016年5月23日
 */
public class BaseThread implements Runnable {
	
	private long waitTime = 1 * 1000;
	
	private boolean isFinish = false;
	
	public long getWaitTime() {
		return waitTime;
	}

	public void setWaitTime(long waitTime) {
		this.waitTime = waitTime;
	}

	public boolean isFinish() {
		return isFinish;
	}

	public void setFinish(boolean isFinish) {
		this.isFinish = isFinish;
	}

	@Override
	public void run() {
		System.out.println("线程启动");
		int i=0;
		while(!isFinish){
			System.out.println(i++);
			try {
				Thread.sleep(waitTime);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		System.out.println("线程结束");
	}

}
